/**
 * Copyright (C) 2017-2018 pinganfang, Inc. All Rights Reserved.
 */
package com.pingan.haofang.searchcloud.user.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.pingan.haofang.searchcloud.user.domain.SearchProject;

/**
 * @author huhailiang937
 * @date 2017年5月2日下午5:28:30
 * @since 1.0.0
 */
@Repository
public interface SearchProjectDao extends JpaRepository<SearchProject, Long>, JpaSpecificationExecutor {


    @Query("from SearchProject sp where sp.masterId = :masterId and sp.status = 0")
    List<SearchProject> findByMasterId(@Param("masterId") Long masterId);

    /**
     * 根据
     *
     * @param status 状态
     * @return
     */
    List<SearchProject> findByStatus(Integer status);

    /**
     * 根据appCode查询
     *
     * @param key
     * @return
     */
    SearchProject findByProjectCode(String key);
}
